using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Network;
using MicroMsg.Plugin;
using MicroMsg.Plugin.QQInfo.Manager;
using MicroMsg.Scene;
using MicroMsg.Storage;
using MicroMsgBackground.Manager;
using Microsoft.Phone.Info;
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using System.Windows.Media.Imaging;
namespace MicroMsg.Manager
{
	public class AccountMgr
	{
		public enum PluginSwitch : uint
		{
			MM_STATUS_GMAIL_OPEN = 1u,
			MM_STATUS_TXWEIBO_OPEN,
			MM_STATUS_RECFBFRIEND_OPEN = 4u,
			MM_STATUS_READAPP_PUSH_OPEN = 8u,
			MM_STATUS_READAPP_TXNEWS_OPEN = 16u,
			MM_STATUS_READAPP_WB_OPEN = 32u,
			MM_STATUS_TXWEIBO_ICON_OPEN = 64u,
			MM_STATUS_MASSSEND_SHOW_IN_CHATLIST_OPEN = 128u,
			MM_STATUS_MEISHI_CARD_OPEN = 256u,
			MM_STATUS_NEWSAPP_TXNEWS_CLOSE = 1024u,
			MM_STATUS_USERNAME_SEARCH_CLOSE = 512u
		}
		public const string TAG = "AccountMgr";
		private const int JPEG_QUALITY = 70;
		private const int MM_HEADIMG_MAX_WIDTH = 132;
		private const int MM_HEADIMG_MAX_HEIGHT = 132;
		private const uint Status_Field_Open = 1u;
		private const uint Status_Field_EmailVerfiy = 2u;
		private const uint Status_Field_MobileVerfiy = 4u;
		private const uint Status_Field_DisableFindMeByQQ = 8u;
		private const uint Status_Field_DisableRecommendMeToQQFriends = 16u;
		private const uint Status_Field_NeedVerify = 32u;
		private const uint Status_Field_RecvOfflineQQMsg = 64u;
		private const uint Status_Field_DisableRecommendQQFriendsToMe = 128u;
		private const uint Status_Field_DisableRecommendMobileFirendsToMe = 256u;
		private const uint Status_Field_DisableFindMeByMobile = 512u;
		private const uint Status_Field_DisableAutoAddFriendWhenReply = 1024u;
		private const uint Status_Field_DisablePushMsgDetail = 2048u;
		private const uint Status_Field_BottleMsgNotify = 4096u;
		private const uint Status_Field_DisplayWeixinOnLine = 8192u;
		private const uint Status_Field_MediaNote = 16384u;
		private const uint Status_Field_BottleInChat = 32768u;
		private const uint Status_Field_DisableUploadMContact = 131072u;
		public const int MODIFY_USERNAME = 1;
		public const int MODIFY_NICKNAME = 2;
		public const int MODIFY_BINDQQ = 4;
		public const int MODIFY_BINDEMAIL = 8;
		public const int MODIFY_BINDMOBILE = 16;
		public const int MODIFY_STATUS = 32;
		public const int MODIFY_PHOTO = 64;
		public const int MODIFY_PERSONALCARD = 128;
		public const int MODIFY_BOTTLEIMG = 256;
		public const int MODIFY_HDHEADIMGMD5SUM = 512;
		public const int MODIFY_BOTTLEHDHEADIMGMD5SUM = 1024;
		public const int MODIFY_PLUGINFLAG = 2048;
		public const int MODIFY_ALL = 4095;
		private static Account curAccount = new Account();
		public static bool hasHeadImg = false;
		public static int mInitRetryTimes = 0;
		public static int mSyncRetryTimes = 0;
		public static string mConstAccountInfo = "";
		public static string mConstDeviceInfo = string.Concat(new object[]
		{
			"DeviceID = ",
			Util.getDeviceUniqueId(),
			", Name=",
			DeviceStatus.get_DeviceName(),
			", Manufacturer=",
			DeviceStatus.get_DeviceManufacturer(),
			", FW=",
			DeviceStatus.get_DeviceFirmwareVersion(),
			", Power=",
			DeviceStatus.get_PowerSource(),
			", OS =",
			Environment.get_OSVersion().get_Platform(),
			", OSVer=",
			Environment.get_OSVersion().get_Version(),
			", HW=",
			DeviceStatus.get_DeviceHardwareVersion()
		});
		private static List<onAccountLoginCallback> loginNotifyList = new List<onAccountLoginCallback>();
		public static bool isLogin
		{
			get;
			private set;
		}
		public static string curUserName
		{
			get
			{
				if (AccountMgr.curAccount.strUsrName == null)
				{
					return "";
				}
				return AccountMgr.curAccount.strUsrName;
			}
		}
		public static bool EmailVerify
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 2u);
			}
		}
		public static bool MobileVerify
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 4u);
			}
			set
			{
				AccountMgr.modifyStatus(4u, value);
			}
		}
		public static bool DisableFindMeByQQ
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 8u);
			}
			set
			{
				if (AccountMgr.modifyStatus(8u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisableFindMeByQQ, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisableFindMeByID
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nPluginSwitch & 512u);
			}
			set
			{
				if (AccountMgr.modifyPluginSwitch(512u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.MM_FUNCTIONSWITCH_USERNAME_SEARCH_CLOSE, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisableRecommendMeToQQFriends
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 16u);
			}
			set
			{
				if (AccountMgr.modifyStatus(16u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisableRecommendMeToQQFriends, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool NeedVerify
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 32u);
			}
			set
			{
				if (AccountMgr.modifyStatus(32u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.NeedVerify, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool RecvOfflineQQMsg
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 64u);
			}
			set
			{
				if (AccountMgr.modifyStatus(64u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.RecvOfflineQQMsg, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisableRecommendQQFriendsToMe
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 128u);
			}
			set
			{
				if (AccountMgr.modifyStatus(128u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisableRecommendQQFriendsToMe, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisableRecommendMobileFirendsToMe
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 256u);
			}
			set
			{
				if (AccountMgr.modifyStatus(256u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisableRecommendMobileFirendsToMe, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisableFindMeByMobile
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 512u);
			}
			set
			{
				if (AccountMgr.modifyStatus(512u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisableFindMeByMobile, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisableAutoAddFriendWhenReply
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 1024u);
			}
			set
			{
				if (AccountMgr.modifyStatus(1024u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisableAutoAddFriendWhenReply, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool BottleMsgNotify
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 4096u);
			}
			set
			{
				if (AccountMgr.modifyStatus(4096u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.BottleMsgNotify, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisplayWeixinOnLine
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 8192u);
			}
			set
			{
				if (AccountMgr.modifyStatus(8192u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisplayWeixinOnLine, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisablePushMsgDetail
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 2048u);
			}
			set
			{
				if (AccountMgr.modifyStatus(2048u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisablePushMsgDetail, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool MediaNote
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 16384u);
			}
			set
			{
				if (AccountMgr.modifyStatus(16384u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.MediaNote, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool ShowBottleInChat
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 32768u);
			}
			set
			{
				if (AccountMgr.modifyStatus(32768u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.BottleInChat, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool DisableUploadMContact
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nStatus & 131072u);
			}
			set
			{
				if (AccountMgr.modifyStatus(131072u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.DisableUploadMContact, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool QQMailPushNotify
		{
			get
			{
				return AccountMgr.curAccount.nPushMailStatus == 1;
			}
			set
			{
				int num = value ? 1 : 0;
				if (AccountMgr.curAccount.nPushMailStatus != num)
				{
					AccountMgr.curAccount.nPushMailStatus = num;
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.QQMailPushNotify, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool ShowWeibo
		{
			get
			{
				return (AccountMgr.curAccount.nWeiboFlag & 1u) == 1u;
			}
			set
			{
				int num = value ? 1 : 0;
				if ((ulong)(AccountMgr.curAccount.nWeiboFlag & 1u) != (ulong)((long)num))
				{
					AccountMgr.curAccount.nWeiboFlag |= (uint)(1 & num);
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.TXWeibo, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static string strTWeiboNickName
		{
			get
			{
				if (AccountMgr.curAccount.strWeiboNickname == null)
				{
					return "";
				}
				return AccountMgr.curAccount.strWeiboNickname;
			}
		}
		public static string strTWeibo
		{
			get
			{
				if (AccountMgr.curAccount.strWeibo == null)
				{
					return "";
				}
				return AccountMgr.curAccount.strWeibo;
			}
		}
		public static bool RecommendFacebookToMe
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nPluginSwitch & 4u);
			}
			set
			{
				if (AccountMgr.modifyPluginSwitch(4u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.RECFBFriend, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static bool disableRecommendTXNewsToMe
		{
			get
			{
				return 0u != (AccountMgr.curAccount.nPluginSwitch & 1024u);
			}
			set
			{
				if (AccountMgr.modifyPluginSwitch(1024u, value))
				{
					OpLogMgr.opFunctionSwitch(OpLogMgr.FunctionID.MM_FUNCTIONSWITCH_NEWSAPP_TXNEWS_CLOSE, value);
					AccountMgr.updateAccount();
				}
			}
		}
		public static string strUsrName
		{
			get
			{
				return AccountMgr.curAccount.strUsrName;
			}
		}
		public static string strNickName
		{
			get
			{
				return AccountMgr.curAccount.strNickName;
			}
			set
			{
				if (AccountMgr.curAccount.strNickName != value)
				{
					AccountMgr.curAccount.strNickName = value;
					OpLogMgr.opModUserInfo(2u, AccountMgr.curAccount);
					AccountMgr.updateAccount();
				}
			}
		}
		public static string strBindEmail
		{
			get
			{
				return AccountMgr.curAccount.strBindEmail;
			}
			set
			{
				if (AccountMgr.curAccount.strBindEmail != value)
				{
					AccountMgr.curAccount.strBindEmail = value;
					OpLogMgr.opModUserInfo(8u, AccountMgr.curAccount);
					AccountMgr.updateAccount();
				}
			}
		}
		public static string strBindMobile
		{
			get
			{
				return AccountMgr.curAccount.strBindMobile;
			}
			set
			{
				if (AccountMgr.curAccount.strBindMobile != value)
				{
					AccountMgr.curAccount.strBindMobile = value;
					OpLogMgr.opModUserInfo(16u, AccountMgr.curAccount);
					AccountMgr.updateAccount();
				}
			}
		}
		public static uint nBindQQ
		{
			get
			{
				return AccountMgr.curAccount.nBindQQ;
			}
			set
			{
				if (AccountMgr.curAccount.nBindQQ != value)
				{
					AccountMgr.curAccount.nBindQQ = value;
					OpLogMgr.opModUserInfo(4u, AccountMgr.curAccount);
					AccountMgr.updateAccount();
				}
			}
		}
		public static uint nStatus
		{
			get
			{
				return AccountMgr.curAccount.nStatus;
			}
			set
			{
				if (AccountMgr.curAccount.nStatus != value)
				{
					AccountMgr.curAccount.nStatus = value;
					OpLogMgr.opModUserInfo(32u, AccountMgr.curAccount);
					AccountMgr.updateAccount();
				}
			}
		}
		public static Account getCurAccount()
		{
			return AccountMgr.curAccount;
		}
		public static bool hasValidAccount()
		{
			return AccountMgr.curAccount != null && (AccountMgr.curAccount.strUsrName != null && AccountMgr.curAccount.strUsrName.get_Length() > 0) && (AccountMgr.curAccount.strPwd != null && AccountMgr.curAccount.strPwd.get_Length() > 0);
		}
		private static void loadAccount(string usrName)
		{
			Account account = StorageMgr.account.method_0(usrName);
			if (account == null)
			{
				AccountMgr.curAccount = new Account(usrName);
				Log.smethod_5("AccountMgr", "load no exist new account " + usrName);
				return;
			}
			Log.smethod_5("AccountMgr", "load exist account " + usrName);
			AccountMgr.curAccount = account;
		}
		public static void init()
		{
			AccountMgr.isLogin = false;
			if (string.IsNullOrEmpty(GConfigMgr.settings.strUsrName))
			{
				return;
			}
			AccountMgr.loadAccount(GConfigMgr.settings.strUsrName);
			AccountMgr.loginStartup();
		}
		public static void uninit()
		{
		}
		public static void logout()
		{
			Log.smethod_5("AccountMgr", "#### logout");
			if (!AccountMgr.isLogin)
			{
				return;
			}
			AccountMgr.isLogin = false;
			ExtentCenter.uninitialize();
			AccountMgr.curAccount.strPwd = null;
			StorageMgr.account.update(AccountMgr.curAccount);
			QFriendMgr.onLogout();
			Sender.getInstance().logoutAccount();
			AccountMgr.mConstAccountInfo = "";
			AccountMgr.logoutNotify();
			StorageMgr.onLogout();
		}
		public static void onLogin(string userName)
		{
			CrashLogMgr.onLogin(userName);
			StorageMgr.onLogin(userName);
			AccountMgr.loadAccount(userName);
			GConfigMgr.settings.strUsrName = userName;
			GConfigMgr.saveSetting();
			AccountMgr.isLogin = true;
			AccountMgr.hasHeadImg = HeadImageMgr.exists(userName, true);
			AccountMgr.mConstAccountInfo = string.Concat(new object[]
			{
				"User = ",
				AccountMgr.curAccount.strUsrName,
				", UIN =",
				AccountMgr.curAccount.nUin,
				" ,Nick=",
				AccountMgr.curAccount.strNickName
			});
			FlowControl.initialize();
			NetSceneNewInit.onLoginHandler();
			NetSceneNewSync.onLoginHandler();
			AccountMgr.loginNotify(userName);
			EventCenter.postEvent(EventConst.ON_ACCOUNT_LOGIN, AccountMgr.curAccount.strUsrName, null);
			Log.smethod_5("AccountMgr", "#### login " + userName);
		}
		private static bool isSessionkeyValid(byte[] Sessionkey)
		{
			if (Sessionkey != null && Sessionkey.Length > 0)
			{
				for (int i = 0; i < Sessionkey.Length; i++)
				{
					if (Sessionkey[i] != 0)
					{
						return true;
					}
				}
				return false;
			}
			return false;
		}
		public static void checkSessionKeyTimeout()
		{
			if (!AccountMgr.hasValidAccount())
			{
				return;
			}
			if (Util.getNowSeconds() > AccountMgr.curAccount.dbLastSessionKeyTimeStamp + 3000.0)
			{
				Log.smethod_5("AccountMgr", "sessionkey should been timeout, clean to autoauth...");
				SessionPackMgr.setSessionKey(null);
			}
		}
		public static void loginStartup()
		{
			if (!AccountMgr.hasValidAccount())
			{
				return;
			}
			CrashLogMgr.onLogin(AccountMgr.curAccount.strUsrName);
			StorageMgr.onLogin(AccountMgr.curAccount.strUsrName);
			AccountMgr.isLogin = true;
			AccountMgr.hasHeadImg = HeadImageMgr.exists(AccountMgr.curAccount.strUsrName, true);
			SessionPackMgr.getAccount().setAuthInfo(AccountMgr.curAccount.strUsrName, AccountMgr.curAccount.strPwd, AccountMgr.curAccount.strPwd2);
			if (AccountMgr.isSessionkeyValid(AccountMgr.curAccount.bytesSessionkey))
			{
				SessionPackMgr.setSessionKey(AccountMgr.curAccount.bytesSessionkey);
				AccountMgr.checkSessionKeyTimeout();
			}
			SessionPackMgr.getAccount().setUin((int)AccountMgr.curAccount.nUin);
			AccountMgr.mConstAccountInfo = string.Concat(new object[]
			{
				"User = ",
				AccountMgr.curAccount.strUsrName,
				", UIN =",
				AccountMgr.curAccount.nUin,
				" ,Nick=",
				AccountMgr.curAccount.strNickName
			});
			FlowControl.initialize();
			NetSceneNewInit.onLoginHandler();
			NetSceneNewSync.onLoginHandler();
			Deployment.get_Current().get_Dispatcher().BeginInvoke(delegate
			{
				EventCenter.postEvent(EventConst.ON_ACCOUNT_LOGIN, AccountMgr.curAccount.strUsrName, null);
			});
			Log.smethod_5("AccountMgr", "#### loginStartup " + AccountMgr.curAccount.strUsrName);
		}
		public static void loginStartupNotify()
		{
			if (!AccountMgr.isLogin)
			{
				return;
			}
			AccountMgr.loginNotify(AccountMgr.strUsrName);
		}
		public static bool updateAccount()
		{
			AccountMgr.mConstAccountInfo = string.Concat(new object[]
			{
				"User = ",
				AccountMgr.curAccount.strUsrName,
				", UIN =",
				AccountMgr.curAccount.nUin,
				" ,Nick=",
				AccountMgr.curAccount.strNickName
			});
			EventCenter.postEvent(EventConst.ON_STORAGE_ACCOUNT_UPDATED, null, null);
			return StorageMgr.account.update(AccountMgr.curAccount);
		}
		public static void registerLoginNotify(onAccountLoginCallback listener)
		{
			if (!AccountMgr.loginNotifyList.Contains(listener))
			{
				AccountMgr.loginNotifyList.Add(listener);
			}
		}
		private static void loginNotify(string usrName)
		{
			using (List<onAccountLoginCallback>.Enumerator enumerator = AccountMgr.loginNotifyList.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					onAccountLoginCallback current = enumerator.get_Current();
					current();
				}
			}
		}
		private static void logoutNotify()
		{
			EventCenter.sendEvent(EventConst.ON_ACCOUNT_LOGOUT, null);
		}
		public static void saveSyncInfoAsync(SyncInfo info)
		{
			if (info == null)
			{
				return;
			}
			ConversationMgr.SetSaveCompleteHandler(delegate
			{
				if (info.bSetCurSyncKey)
				{
					AccountMgr.curAccount.bytesCurSyncKey = info.bytesCurSyncKey;
				}
				if (info.bSetMaxSyncKey)
				{
					AccountMgr.curAccount.bytesMaxSyncKey = info.bytesMaxSyncKey;
				}
				if (info.bSetInitStatus)
				{
					AccountMgr.curAccount.nInitStatus = info.nInitStatus;
				}
				if (info.bSetSyncKey)
				{
					AccountMgr.curAccount.bytesSyncKeyBuf = info.bytesSyncKeyBuf;
				}
				AccountMgr.updateAccount();
				MicroMsgBackground.Manager.AccountMgr.delBackgroundData();
				Log.smethod_5("AccountMgr", "ConversationMgr save  sync Key finish!");
			});
		}
		public static string GetCurrentLanguage()
		{
			string strUserSetLanguage = GConfigMgr.settings.strUserSetLanguage;
			if ("zh-CN" == strUserSetLanguage)
			{
				return "zh_CN";
			}
			if ("zh-TW" == strUserSetLanguage)
			{
				return "zh_TW";
			}
			if ("de-DE" == strUserSetLanguage)
			{
				return "de_DE";
			}
			return "en";
		}
		private static bool modifyStatus(uint uint_0, bool bSet)
		{
			uint nStatus = AccountMgr.curAccount.nStatus;
			if (bSet)
			{
				AccountMgr.curAccount.nStatus |= uint_0;
			}
			else
			{
				AccountMgr.curAccount.nStatus &= ~uint_0;
			}
			return nStatus != AccountMgr.curAccount.nStatus;
		}
		public static bool HasTWeibo()
		{
			return !string.IsNullOrEmpty(AccountMgr.strTWeibo);
		}
		private static bool modifyPluginSwitch(uint uint_0, bool bSet)
		{
			uint nPluginSwitch = AccountMgr.curAccount.nPluginSwitch;
			if (bSet)
			{
				AccountMgr.curAccount.nPluginSwitch |= uint_0;
			}
			else
			{
				AccountMgr.curAccount.nPluginSwitch &= ~uint_0;
			}
			return nPluginSwitch != AccountMgr.curAccount.nPluginSwitch;
		}
		public static bool isAccountOwner(string userName)
		{
			return AccountMgr.strUsrName == userName;
		}
		public static SelfPersonCard getSelfPersonCard()
		{
			return new SelfPersonCard
			{
				nPersonalCard = AccountMgr.curAccount.nPersonalCard,
				nSex = AccountMgr.curAccount.nSex,
				strProvince = AccountMgr.curAccount.strProvince,
				strCity = AccountMgr.curAccount.strCity,
				strSignature = AccountMgr.curAccount.strSignature
			};
		}
		public static void setSelfPersonCard(SelfPersonCard card)
		{
			AccountMgr.curAccount.nPersonalCard = 1u;
			AccountMgr.curAccount.nSex = card.nSex;
			AccountMgr.curAccount.strProvince = card.strProvince;
			AccountMgr.curAccount.strCity = card.strCity;
			AccountMgr.curAccount.strSignature = card.strSignature;
			OpLogMgr.opModUserInfo(128u, AccountMgr.curAccount);
			AccountMgr.updateAccount();
		}
		public static void saveHeadImg(Stream fileStream)
		{
			HeadImageMgr.save(AccountMgr.strUsrName, fileStream);
		}
		public static void saveBottleHeadImg(Stream fileStream)
		{
			HeadImageMgr.save(AccountMgr.strUsrName + "@bottle", fileStream);
		}
		public static BitmapImage getHeadimg()
		{
			return HeadImgMgr.getHeadImage(AccountMgr.curAccount.strUsrName, false);
		}
		public static BitmapImage getBottletHeadimg()
		{
			return HeadImgMgr.getHeadImage(AccountMgr.curAccount.strUsrName + "@bottle", false);
		}
		public static bool IsAcountInfoCompleted()
		{
			Account account = AccountMgr.getCurAccount();
			return account != null && (!string.IsNullOrEmpty(account.strProvince) || !string.IsNullOrEmpty(account.strCity)) && (account.nSex == 1 || account.nSex == 2);
		}
		public static bool hasTWeibo()
		{
			return !string.IsNullOrEmpty(AccountMgr.strTWeibo);
		}
	}
}
